#!/bin/bash -e

APP_NAME="app"
MIGRATION_NAME="migration"
REPO_PREFIX="joidevops"
GIT_HASH=$(git rev-parse --short HEAD)
TAG_TIME=$(date +'%Y%m%d%H%M')
PROJECT_NAME=${PROJECT_NAME:-joi}
KUBE_CONFILE="./config/kube-config.txt"

display_status() {
  echo ">>> $1 <<<" 1>&2
}

function terraform() {
  docker run --rm \
  -v ${PWD}:/working \
  -w /working \
  hashicorp/terraform $@
}

function kubectl() {
  docker run --rm \
  -v ${PWD}/${KUBE_CONFILE}:/.kube/config \
  -v ${PWD}:/working \
  -w /working \
  bitnami/kubectl $@
}

function kustomize() {
  docker run --rm \
  -v ${PWD}/k8s:/working \
  -w /working \
  bitlayer/kustomize:v2.1.0 $@
}
